import { areaList } from '@vant/area-data';

Component({
  // 接受子组件
  properties: {
    showlocation:Boolean,
    locationtype:'', 
  },

  /**
   * 组件的初始数据
   */
  data: {
    areaList,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onCancellocation(){
        this.setData({
        showlocation: false,
      });
    },
    onConfirmlocation(e){
      let locationname = e.detail.values[0].name+'-'+e.detail.values[1].name+'-'+e.detail.values[2].name
      let locationtype = this.properties.locationtype
      this.triggerEvent('pickerlocation', {
        locationname: locationname,
        locationtype: locationtype
      })
      this.setData({
        showlocation: false,
      });
    }
  }
})
